<include file="nav:header"/>
<div class="container-fluid">
    <div class="row">
        <include file="Left:left-Common"/>
        <!-- right -->
        <div class="col-md-10 right">
            <div class="page-header" style="margin-right: 15px">
                <h3>{$page_title}</h3>
            </div>
            <div class="col-md-12">
                <div class="btn-group " role="group" aria-label="Large button group">
                    <a href="{:U('Create/create_page')}" type="button" class="btn btn-default"> ھاسىل بولغان بەتلەر</a>
                    <a href="{:U('Create/add')}" type="button" class="btn btn-default">بەت قوشۇش</a>
                </div>
                <!--所有分类-->
                <br><br>
                <table class="table table-bordered">
                    <thead>
                    <tr class="info">
                        <th width="50">CID</th>
                        <th>بەت نامى</th>
                        <th style="text-align: center"> قوشۇلغان ۋاقتى</th>
                        <th style="text-align: center">مەشغۇلات</th>
                    </tr>
                    </thead>
                    <tbody>
                        <foreach name="classifys" item="c">
                            <input type="hidden" value="{$url=$c['htmlname']}">
                            <tr class="classifys active tr_{$c['id']}">
                                <td>{$c['id']}</td>
                                <td width="600" style="font-size: 15px;direction: ltr;color: #666">
                                    <a target="_blank" href="/index.php/Admin/Create/{$c.htmlname|_substr_url}">{:$_SERVER['SERVER_NAME']}/index.php/Admin/Create/{$c.htmlname|_substr_url}</a>
                                </td>
                                <td style="text-align: center">{$c.intime|DateFormat_convert}</td>
                                <td style="text-align: center">
                                    <a  style="margin-top: 6px;display: inline-block;" href="javascript:;" onclick="del({$c['id']},'{$url}')" class="btn btn-danger btn-xs">ئۆچۈرۈش</a>
                                </td>
                            </tr>
                        </foreach>
                    </tbody>
                </table>
                <if condition="$count gt  $meige">
                    <div style="margin-top: -15px" class="page_ye">
                        <dl>
                            <dd>جەمئى {$count} تال ئۇچۇر بار</dd>
                        </dl>
                        <!--分页-->
                        {$page}
                        <div style="clear:both;height: 2px;"></div>
                    </div>
                </if>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    //删除分类
    function del(id,link) {
        layer.confirm('بۇ ئۇچۇرنى راستىنلا ئۆچۈرەمسىز ؟', {
            title:"سېستىما ئەسكەرتىشى",
            btn: ['ھەئە','ياق'] //按钮
        }, function(){
            $.ajax({
                type:"post",
                url:"{:U('Create/del')}",
                dataType:"json",
                data:{"id":id,'link':link},
                success:function (phpdata) {
                    if(phpdata.status==1){
                        layer.alert(phpdata.message, {
                            title:"سېستىما ئەسكەرتىشى",
                            btn:"بىلدىم",
                            icon: 6,
                            skin: 'layer-ext-moon',
                            time:1000
                        });
                        setTimeout(function () {
                            $(".tr_"+phpdata.id).fadeOut(500);
                        },1100)
                    }else{
                        layer.alert(phpdata.message, {
                            title:"سېستىما ئەسكەرتىشى",
                            btn:"بىلدىم",
                            icon: 5,
                            skin: 'layer-ext-moon',
                            time:1000
                        });
                    }
                }
            })
        });

    }

    $(function () {
        $('.classifys').hover(function () {
            $(this).addClass('info');
        },function () {
            $(".classifys").removeClass('info');
        })
    })
</script>
<include file="nav:footer"/>